<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
<head>
	<base href="<%=basePath%>">
	<meta charset="UTF-8">
	<title>商品列表</title>
</head>
<body>

	<div align="center"><h1>商品列表</h1></div>
	
	<table border="1" style="border-spacing: 0">
		<thead>
			<tr>
				<th>商品名</th>
				<th>类别</th>
				<th>价格</th>
				<th>折扣</th>
				<th>库存量</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
		<s:iterator value="products" var="p">
			<tr>
				<td>${p.productName}</td>
				<td>${p.sortId}</td>
				<td>${p.price}</td>
				<td>${p.discount}</td>
				<td>${p.inventory}</td>
				<td></td>
			</tr>
		</s:iterator>
		</tbody>
	</table>
		共${products.size()}件商品<br>
		<s:actionmessage/>
			
	<s:actionerror/>
</body>
</html>